﻿@import "variables.less";
@import "mixins.less";
//
// 按钮
//
// 基本样式
.btn {
    display: inline-block;
    border: @btn-border;
    color: @btn-color;
    background: @btn-bg;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    white-space: nowrap;
    .button-size(@btn-padding, @btn-border-radius, @btn-font-size, @btn-line-height);
    &:active,
    &.active:focus,
    &.active.focus,
    &[type="button"]:hover,
    &[type="submit"]:hover,
    &:focus,
    &.focus {
        text-decoration: none;
    }
    &.disabled,
    &[disabled],
    &.disabled:hover,
    &[disabled]:hover {
        .opacity(.65);
        .box-shadow(none);
    }
    a& {
        &.disabled,
        &[disabled] {
            pointer-events: none;
        }
    }
    &.medium {
        border-width: 2px !important;
        .button-size(@btn-medium-padding, @btn-medium-border-radius, @btn-medium-font-size, @btn-medium-line-height);
        &:active,
        &:hover {
            border-width: 2px !important;
        }
        >img {
            .icon(24px, 0 .5em 0 0);
        }
    }
    &.small {
        .button-size(@btn-small-padding, @btn-small-border-radius, @btn-small-font-size, @btn-small-line-height);
        >img {
            .icon(18px, 0 .5em 0 0);
        }
    }
    >img {
        .icon();
    }
}

.btn-default {
    .button-variant(@btn-default-border, @btn-default-color, @btn-default-bg);
}

.btn-primary {
    .button-variant(@btn-primary-border, @btn-primary-color, @btn-primary-bg);
}

.btn-success {
    .button-variant(@btn-success-border, @btn-success-color, @btn-success-bg);
    .badge{
        color: #5cb85c;
        background: #ffffff;
        padding: 0 10px;
        border-radius: 5px;
        margin-left: 5px;
    }
}

.btn-info {
    .button-variant(@btn-info-border, @btn-info-color, @btn-info-bg);
}

.btn-warning {
    .button-variant(@btn-warning-border, @btn-warning-color, @btn-warning-bg);
}

.btn-danger {
    .button-variant(@btn-danger-border, @btn-danger-color, @btn-danger-bg);
}

// 覆盖特殊表单
input[type="submit"],
input[type="reset"],
input[type="button"] {
    &.btn-block {
        width: 100%;
    }
}